#include <iostream>
#include <iomanip>

using namespace std;

void CSretirementCalc ()
    {

    char answer='y';

    cout << "*************SIMPLE RETIREMENT CALCULATOR**************" << endl;
    cout << "*****************by Christian Semana*******************" << endl;
    cout << endl;
    cout << "-------------------------------------------------------" << endl;
    cout << "The following simple formula computes the dollar amount" << endl;
    cout << " that you must accumulate to ensure a stable nest egg." << endl;
    cout << "-------------------------------------------------------" << endl;
    cout << endl;
    cout << endl;

    do
    {
        double nestEggAmount;
        double annualWithdrawal;
        double rateOfReturn;
        cout << "Enter estimated annual withdraw amount (ie: 20000, 40000):" << endl;
        cin >> annualWithdrawal;
        cout << endl;
        cout << "Enter annual rate of return (ie: 4%, 6%):" << endl;
        cin >> rateOfReturn;
        cout << endl;
        nestEggAmount = annualWithdrawal/(rateOfReturn/100);
        cout << "Your required Nest Egg is: $" << nestEggAmount << fixed << setprecision(2) <<endl;
        cout << endl;
        cout << "-------------------------------------------------------" << endl;
        cout << endl;
        cout << "Calculate another amount (y/n)?";
        cin >> answer;
        cout << endl;
        cout << endl;
    }
    while (answer=='y');

    cout << "Thank you for using SIMPLE RETIREMENT CALCULATOR" << endl;
    cout << endl;

system("pause");


}